<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/25
 * Time: 16:53
 */

namespace app\stage\widget;
use think\Db;
class Mkg
{
      public function getMcateName($id)
      {
          $data = Db::table('php_mcate')->where(['id' => $id])->find();
          return $data['title'];
      }
      //获取所诉商家
    public function getMemberName($id)
    {
        $data = Db::table('php_store_member')->where(['id' => $id])->find();
        return $data['store_name'];
    }
    //获取拼本的商品的名称
    public function getShopName($id)
    {
        $data = Db::table('php_hshop')->where(['id' => $id])->find();
        return $data['sname'];
    }
    //获取拼本的商品的名称
    public function getArtcateName($id)
    {
        $data = Db::table('php_artcate')->where(['id' => $id])->find();
        return $data['title'];
    }
    //获取所属用户
    public function getUsername($id)
    {
        $data = Db::table('php_member')->where(['id' => $id])->find();
        return $data['nickname'];
    }

    //获取圈子所属分类
    public function getQcate($id)
    {
        $data = Db::table('php_q_cate')->where(['id' => $id])->find();
        return $data['title'];
    }

    //获取拼本所属分类
    public function getPinbenCate($id)
    {
        $data = Db::table('php_pinben_cate')->where(['id' => $id])->find();
        return $data['title'];
    }

    //获取商家关注数量
    public function getStoreLikeNum($id)
    {
        $data = Db::table('php_store_like')->where(['mid' => $id])->count();
        return $data ? $data:0;
    }


}